package com.service.impl;

import com.dao.CollegeDao;
import com.dao.StudentDao;
import com.entity.CollegeSort;
import com.entity.Student;
import com.excel.StudentExcel;
import com.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("studentService")
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentDao studentDao;
    @Autowired
    private CollegeDao collegeDao;

    @Override
    public Map<String, CollegeSort> queryCollegeSort() {
        return collegeDao.queryCollegeSort();
    }

    @Override
    public List<String> queryStudentNumberAll() {
        return studentDao.queryNumberAll();
    }

    @Override
    public int insertBatchStudent(List<Student> studentList) {
        return studentDao.insertBatch(studentList);
    }

    @Override
    public long countStudent() {
        return studentDao.count();
    }

    @Override
    public List<StudentExcel> queryStudentLimit(int pageId, int count) {
        return studentDao.queryAllLimit((pageId-1)*count, count);
    }

    @Override
    public List<String> queryStudentIdentityAll() {
        return studentDao.queryIdentityAll();
    }
}
